<!DOCTYPE html>
<#assign ctx=request.contextPath>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="${ctx}/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/css/style.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/css/admin-right.css" />
    <script type="text/javascript" src="${ctx}/js/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="${ctx}/js/jquery-migrate-1.2.1.js"></script>

    <script src="${ctx}/js/artDialog-6.0.2/dist/dialog-min.js"></script>
	<link rel="stylesheet" href="${ctx}/js/artDialog-6.0.2/css/ui-dialog.css">
	<script type="text/javascript">
     function deletes(id){
    		var d = dialog({
				title: '温馨提示',
			    content: '<img src=${ctx}/images/logo3.jpg style="width:200px;height:124px;"><br><font size=3 color=red>您确定要删除对应的数据吗?</font>',
			    okValue:'确定',
			    ok:function(){
			    	this.title("请稍等...");
			    	window.location="${ctx}/admin/order/delete?id="+id;
			    	return false;
			    },
			    cancelValue:'取消',
			    cancel:function(){}
			});
			d.showModal();
    	}
     </script>
</head>
<body>
<br>
<form class="form-inline definewidth m20" action="${ctx}/admin/order/orderList" method="post">    
		    订单编号：<input  type="text" name="orderCode" cssStyle="width:155px;" class="abc input-default" placeholder="请输入需要查询的订单编号"/>
		    用户：<input  type="text" name="user.name" cssStyle="width:155px;" class="abc input-default" placeholder="请输入需要查询的用户"/>
		    &nbsp;&nbsp;<button type="submit" class="btn btn-primary">查询</button>
</form>
<table class="table table-bordered table-hover definewidth m10" >
    <thead>
    <tr>
        <th>编号</th>
        <th>订单编号</th>
        <th>用户</th>
        <th>下单时间</th>
        <th>发货时间</th>
        <th>交易状态</th>
        <th>订单总金额</th>
        <th>支付状态</th>
        <th colspan="3" style="text-align:center">操作</th>
    </tr>
    </thead>
    	<#if orderList??>
    	<#list orderList as order>
	     <tr>
            <td>${order.id}</td>
            <td>
            	${order.orderCode}
            </td>
            <td>${order.user.name}</td>
            <td>${order.createDate?string("yyyy-MM-dd HH:mm:ss")}</td>
            <td>
            <#if order.sendDate??>
            	${order.sendDate?string("yyyy-MM-dd HH:mm:ss")}
            <#else>
            	<font color="red">未发货</font>
            </#if>
            </td>
            <td>
            	<#if order.tradingStatus = 1>
            		<font color='green'>交易成功</font>
            	<#elseif order.tradingStatus =0>
            		<font color='green'>物流运输中</font>
            	<#else>
            		<font color="red">交易失败</font>
            	</#if>
            </td>
            <td>${order.totalAmount}</td>
            <td>
            	<#if order.alipay = 1>
            		<font color="green">已支付</font>
            	<#else>
            	     <font color="red">未支付</font>
            	</#if>
            </td>
            <td>
            	<a href="${ctx}/admin/order/showDetail?id=${order.id}">订单明细</a>
            </td>
            <td>
            	<a href="${ctx}/admin/order/showUpdate?id=${order.id}">修改</a>
            </td>
             <td>
             	<a href="javascript:;" onclick="deletes(${order.id})">删除</a>
            </td>
        </tr>
        </#list>
        </#if>
        </table>
        <#if pageModel.recordCount??>
		<!-- 分页标签-->
		<div id="pagerInfo" style="margin:5px 0px; 
		text-align:center;background-color:#FFFF00;color:blue">
  		共${pageModel.recordCount}条,
  		分${((pageModel.recordCount+pageModel.pageSize -1)/pageModel.pageSize)?int}页
  		</div>
  	 	<div id="pager">
  		<#import "../common/pager.html" as page>
  		<@page.pager pageIndex=pageModel.pageIndex pageSize=pageModel.pageSize 
  		recordCount=pageModel.recordCount toURL="${ctx}/admin/order/orderList"/>
    	</div>
        </#if>

  </body>
</html>